from aiogram.filters.callback_data import CallbackData
from aiogram.types import InlineKeyboardMarkup
from aiogram.utils.keyboard import InlineKeyboardBuilder
from fluentogram import TranslatorRunner


class DepositCF(CallbackData, prefix="depositnum"):
    deposit_id: int


class AccountCF(CallbackData, prefix="accountnum"):
    account_id: int


class WithdrawCF(CallbackData, prefix="withdeawnum"):
    withdraw_id: int


def deposit_payment_confirmation_kb(
    locale: TranslatorRunner, deposit_id: int
) -> InlineKeyboardMarkup:
    builder = InlineKeyboardBuilder()
    builder.button(
        text=locale.get("go-to-deposit-btn"),
        callback_data=DepositCF(deposit_id=deposit_id),
    )

    return builder.as_markup()


def account_confirmation_kb(
    locale: TranslatorRunner, account_id: int
) -> InlineKeyboardMarkup:
    builder = InlineKeyboardBuilder()
    builder.button(
        text=locale.get("go-to-account-btn"),
        callback_data=AccountCF(account_id=account_id),
    )

    return builder.as_markup()


def withdraw_confirmation_kb(
    locale: TranslatorRunner, withdraw_id: int
) -> InlineKeyboardMarkup:
    builder = InlineKeyboardBuilder()
    builder.button(
        text=locale.get("go-to-withdraw-btn"),
        callback_data=WithdrawCF(withdraw_id=withdraw_id),
    )

    return builder.as_markup()
